<script setup>
import { ref } from "vue";
import { dayjs } from "element-plus";
import { useUserStore } from "@/store/modules/useUserStore";
const userInfoStore = useUserStore();
const userName = ref("");
userName.value = userInfoStore.userInfo.user_name;

const nowTime = ref(null);
const nowDate = () => {
  nowTime.value = dayjs().format("YYYY-MM-DD HH:mm:ss");
};
setInterval(() => {
  nowDate();
}, 1000);
</script>
<template>
  <div>
    <el-card class="box-card" shadow="never">
      <h2>{{ userName }} 欢迎您！</h2>
      <el-text class="mx-1" size="large">现在是：{{ nowTime }}</el-text>
    </el-card>
  </div>
</template>
<style lang="scss" scoped>
.mx-1 {
  display: inline-block;
  margin-top: 12px;
}
</style>
